import request from '@/utils/request'
// 获取工单状态
export const getallTaskStatus = () => request.get('/api/task-service/task/allTaskStatus')
// 获取所有工单类型
export const getTaskType = () => request.get('/api/task-service/taskType/list')
// 工单搜索isRepair=true代表运维工单，isRepair=true代表运营工单
export const getTaskSearch = (params) => request.get('/api/task-service/task/search', { params })
// 获取补货预警值
export const getAlertValue = () => request.get('/api/task-service/task/supplyAlertValue')
// 设置自动补货工单阈值
export const autoSupplyConfig = (alertValue) => request.post('/api/task-service/task/autoSupplyConfig', { alertValue })
// 根据售货机获取运营人员列表
export const getOperatorList = (innerCode) => request.get(`/api/user-service/user/operatorList/${innerCode}`)
// 获取售货机货道详情
export const getChannelList = (innerCode) => request.get(`/api/vm-service/channel/channelList/${innerCode}`)
// 创建工单
export const taskCreate = (data) => request.post('/api/task-service/task/create', data)
// 补货详情
export const getTaskDetails = (taskId) => request.get(`/api/task-service/taskDetails/${taskId}`)
// 获取工单详情
export const getTaskInfo = (taskId) => request.get(`/api/task-service/task/taskInfo/${taskId}`)
// 取消工单
export const TaskCancel = (taskId) => request.post(`/api/task-service/task/cancel/${taskId}`, { taskId, desc: '' })
// 订单搜索
export const orderSearch = (params) => request.get('/api/order-service/order/search', { params })
